package com.javacoo.junit.generator.maven.callback;

import org.apache.maven.plugin.logging.Log;

import com.javacoo.junit.generator.api.ProgressCallback;


/**
 * maven日志记录进度
 * <li>此回调使用Maven记录器记录进度消息。</li>
 * @author duanyong@jccfc.com
 * @date 2021/1/4 13:50
 */
public class MavenProgressCallback implements ProgressCallback {

    private final Log log;
    private final boolean verbose;

    public MavenProgressCallback(Log log, boolean verbose) {
        super();
        this.log = log;
        this.verbose = verbose;
    }

    @Override
    public void startTask(String subTaskName) {
        if (verbose) {
            log.info(subTaskName);
        }
    }
    @Override
    public void done() {
        if (verbose) {
            log.info("执行完成");
        }
    }
}
